package com.test.shop.util;

/**
 * @author 徒有琴
 */
public class AccountUtil {
    public static boolean checkMobile(String mobile) {
        if (mobile == null || mobile.length() != 11) {
            return false;
        }
        String reg = "^1[3|4|5|8]\\d{9}$";
        return mobile.matches(reg);
    }

    public static void main(String[] args) {
        int num = 123456;


        System.out.println(test1(num, 0));
    }

    public static int test2(int num) {
        int res = 0;
        while (num > 0) {
            res *= 10;
            res += num % 10;
            num /= 10;
        }
        return res;
    }

    public static int test1(int num, int res) {
        if (num == 0) {
            return res;
        }
        res *= 10;
        res += num % 10;
        return test1(num / 10, res);
    }

}
